/*
 * @Author: 徐建辰
 * @Date: 2021-11-05 14:21:21
 * @LastEditTime: 2021-11-05 14:44:24
 * @LastEditors: Please set LastEditors
 * @Description: query页面store初始值
 */
import {createStore, combineReducers, applyMiddleware} from 'redux'
import thunk from 'redux-thunk'
import reducers from './reducers'
import {formatTime} from '@/utils/format'
import {ORDER_DEPART} from './constant'

export default createStore(
  combineReducers(reducers),
  {
    from: null,
    to: null,
    departDate: formatTime(Date.now()), //出发日期
    highSpeed: false, //是否选择了高铁动车
    trainList: [], //车次列表
    orderType: ORDER_DEPART,
    onlyTickets: false, //只看有票
    ticketTypes: [], //所有的筛选项列表
    checkedTicketTypes: {}, //选中的筛选项
    trainTypes: [], //车次类型
    checkedTrainTypes: {},
    departStations: [], //出发车站列表
    checkedDepartStations: {},
    arriveStations: [], //到达车站
    checkedArriveStations: {},
    // 出发、到达的开始、结束时间
    departTimeStart: 0,
    departTimeEnd: 24,
    arriveTimeStart: 0,
    arriveTimeEnd: 24,
    isFiltersVisible: false, //是否显示筛选弹窗
    searchParsed: false, //地址栏中的参数等是否已经解析完成
  },
  applyMiddleware(thunk)
)
